<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/10 010
 * Time: 16:42
 */
namespace App\Beverage;

class Soy extends CondimentDecorator
{
    public $beverage;

    public function __construct(Beverage $beverage)
    {
        $this->beverage = $beverage;
    }

    public function getSize()
    {
        return $this->beverage->getSize();
    }

    public function getDescription()
    {
        return $this->beverage->getDescription() . ", Soy"; // TODO: Change the autogenerated stub
    }

    public function cost()
    {
        // TODO: Implement cost() method.
        //return .15 + $this->beverage->cost();
        $cost = $this->beverage->cost();
        if ($this->getSize() == Beverage::TALL){
            $cost += .10;
        } else if ($this->getSize() == Beverage::GRANDE){
            $cost += .15;
        } else if ($this->getSize() == Beverage::VENTI){
            $cost += .20;
        }
        return $cost;
    }
}